import Vue from 'vue'
import Router from 'vue-router'
const routerPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return routerPush.call(this, location).catch(error => error)
}
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '首页',
      component: () => import('@/views/Template.vue'),
      redirect: '/index',
      meta: {auth: true}
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login.vue'),
      meta: {auth: false}
    },
    {
      path: '/modules',
      component: () => import('@/views/Modules.vue'),
      children: [
        {
          path: '/index',
          name: '后台首页',
          component: () => import('@/views/index.vue'),
          meta: {auth: true, id: '576700593796644866'}
        },
        // 统计分析
        {
          path: '/influenceAnalysis',
          name: '绩效分析',
          component: () => import('@/views/tongjifenxi/InfluenceAnalysis.vue'),
          meta: {auth: true, id: '651335777296338945'}
        },
        {
          path: '/benefitAnalysis',
          name: '效益分析',
          component: () => import('@/views/tongjifenxi/BenefitAnalysis.vue'),
          meta: {auth: true, id: '651335687739559938'}
        },
        {
          path: '/caseAnalysis',
          name: '案件分析',
          component: () => import('@/views/tongjifenxi/CaseAnalysis.vue'),
          meta: {auth: true, id: '651335584064753665'}
        },
        // 客户管理
        {
          path: '/trustor',
          name: '委托人',
          component: () => import('@/views/kehuguanli/Trustor.vue'),
          meta: {auth: true, id: '651109035952689153'}
        },
        {
          path: '/plaintiff',
          name: '原告',
          component: () => import('@/views/kehuguanli/Plaintiff.vue'),
          meta: {auth: true, id: '651109985459228673'}
        },
        {
          path: '/plaintiffUnit',
          name: '原告单位',
          component: () => import('@/views/kehuguanli/PlaintiffUnit.vue'),
          meta: {auth: true, id: '651111910380523522'}
        },
        {
          path: '/defendant',
          name: '被告',
          component: () => import('@/views/kehuguanli/Defendant.vue'),
          meta: {auth: true, id: '651112406587658242'}
        },
        {
          path: '/defendantUnit',
          name: '被告单位',
          component: () => import('@/views/kehuguanli/DefendantUnit.vue'),
          meta: {auth: true, id: '651113032738525186'}
        },
        // 系统管理
        {
          path: '/user',
          name: '用户管理',
          component: () => import('@/views/xitongshezhi/User.vue'),
          meta: {auth: true, id: '651336132025405441'}
        },
        {
          path: '/departMent',
          name: '部门管理',
          component: () => import('@/views/xitongshezhi/DepartMent.vue'),
          meta: {auth: true, id: '651336599598026754'}
        },
        {
          path: '/unit',
          name: '单位管理',
          component: () => import('@/views/xitongshezhi/Unit.vue'),
          meta: {auth: true, id: '651364521658568705'}
        },
        {
          path: '/role',
          name: '角色管理',
          component: () => import('@/views/xitongshezhi/Role.vue'),
          meta: {auth: true, id: '651337621754105858'}
        },
        {
          path: '/permission',
          name: '权限管理',
          component: () => import('@/views/xitongshezhi/Permission.vue'),
          meta: {auth: true, id: '651338312937656321'}
        },
        {
          path: '/dictionType',
          name: '字典类型',
          component: () => import('@/views/xitongshezhi/dictionData/dictionType.vue'),
          meta: {auth: true, id: '651426355191246849'}
        },
        {
          path: '/dictionMent',
          name: '字典列表',
          component: () => import('@/views/xitongshezhi/dictionData/dictionMent.vue'),
          meta: {auth: true, id: '651426526415319041'}
        },
        // 案件管理
        {
          path: '/consultCase',
          name: '咨询',
          component: () => import('@/views/anjianguanli/ConsultCase.vue'),
          meta: {auth: true, id: '651104474168938497'}
        },
        {
          path: '/receivedCase',
          name: '收案',
          component: () => import('@/views/anjianguanli/ReceivedCase.vue'),
          meta: {auth: true, id: '651105372953759746'}
        },
        {
          path: '/handleCase',
          name: '办案',
          component: () => import('@/views/anjianguanli/HandleCase.vue'),
          meta: {auth: true, id: '651106520796352514'}
        },
        {
          path: '/registerCase',
          name: '审理',
          component: () => import('@/views/anjianguanli/RegisterCase.vue'),
          meta: {auth: true, id: '651107142522228737'}
        },
        {
          path: '/closureCase',
          name: '结案',
          component: () => import('@/views/anjianguanli/ClosureCase.vue'),
          meta: {auth: true, id: '651107773102280705'}
        },
        // 法院管理
        {
          path: '/court',
          name: '受理单位管理',
          component: () => import('@/views/fayuanguanli/Court.vue'),
          meta: {auth: true, id: '651113922123911170'}
        },
        {
          path: '/judge',
          name: '承办人管理',
          component: () => import('@/views/fayuanguanli/Judge.vue'),
          meta: {auth: true, id: '651114483837685761'}
        },
        // 法律顾问
        {
          path: '/companyMent',
          name: '企业管理',
          component: () => import('@/views/falvguwen/companyMent.vue'),
          meta: {auth: true, id: '651834352665182209'}
        },
        {
          path: '/serviceRecod',
          name: '服务记录',
          component: () => import('@/views/falvguwen/serviceRecod.vue'),
          meta: {auth: true, id: '651834531447316481'}
        }
      ]
    }
  ]
})
